import { createRouter, createWebHistory } from 'vue-router'
import home from '@/views/home/index.vue'
import search from '@/views/search/index.vue'


import index from '@/views/home/children/index.vue'
import list from '@/views/home/children/list.vue'
import shop from '@/views/home/children/shop.vue'
import my from '@/views/home/children/my.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: 'home',
    },
    {
      path: '/home',
      name: 'home',
      component:home,
      children:[
        {
      path: 'index',
      name: 'index',
      component:index,
    },
    {
      path: 'list',
      name: 'list',
      component:list,
    },
    {
      path: 'shop',
      name: 'shop',
      component:shop,
    },
        {
      path: 'my',
      name: 'my',
      component:my,
    },
      ]
    },
    {
      path: '/search',
      name: 'search',
      component:search,
    },
  ],
})

export default router
